package com.woniuxy.mesboot.controller;

import com.woniuxy.mesboot.entity.ChildrenNameId;
import com.woniuxy.mesboot.mapper.NameIdMapper;
import com.woniuxy.mesboot.util.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@RequestMapping("/common")
@RestController
public class NameIdController {
    private static Map<String, Object> map = new HashMap<>();
    @Resource
    private NameIdMapper nameIdMapper;

    @GetMapping("/getNameIdOfFLR")
    public Result getNameIdOfFLR(@PathVariable Long id){
        List<ChildrenNameId> nameIdList = nameIdMapper.getNameIdOfFLR(id);
        map.clear();
        map.put("vos",nameIdList);
        return Result.ok().data(map);
    }

}